package com.prs.crm.domain.crm;

import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;
/**
 * 项目
 * @author zhoupeng 2012-02-16
 *
 */
@Entity
@Table(name="crm_project")
public class CustomerProject extends BaseEntity {
	private static final long serialVersionUID = 1L;
	
	@Id@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	private String procode; //项目编号
	private String name;   //项目名称
	private String demand;  //需求描述
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach;  //项目附属文件
	@Column(name="project_file")
	private String project_file;  //附属文件路径
	
	private String iscontract;  //是否签订合同
	
	private String linkman;  //联系人姓名
	private String mobile;  //手机
	private String phone;  //电话
	private String fax;   //传真
	private String other;  //其他联系方式
	@ManyToOne
	private Customer customer;  //客户
	
	private String person; //业务人员
	private String shareperson;  //共享人员
	
	private Date repairDay;  //维修截止日
	
	private Date day;  //时间段查询用的
	private String rePerson;
	//项目合同
	@OneToMany(fetch=FetchType.LAZY,mappedBy="customerProject")
	private Set<ProjectContract> projectContract;
	//跟单
	@OneToMany(fetch=FetchType.LAZY,mappedBy="customerProject")
	private Set<DocumenTary> tarys;
	//配置单
	@OneToMany(fetch=FetchType.LAZY,mappedBy="customerProject")
	private Set<Configure> configures;
	
	//故障信息
	@OneToMany(fetch=FetchType.LAZY,mappedBy="customerProject")
	private Set<Fault> faults;
	
	
	public String getRePerson() {
		return rePerson;
	}
	public void setRePerson(String rePerson) {
		this.rePerson = rePerson;
	}
	public Set<Fault> getFaults() {
		return faults;
	}
	public void setFaults(Set<Fault> faults) {
		this.faults = faults;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getProcode() {
		return procode;
	}
	public void setProcode(String procode) {
		this.procode = procode;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDemand() {
		return demand;
	}
	public void setDemand(String demand) {
		this.demand = demand;
	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
	public String getIscontract() {
		return iscontract;
	}
	public void setIscontract(String iscontract) {
		this.iscontract = iscontract;
	}
	public String getLinkman() {
		return linkman;
	}
	public void setLinkman(String linkman) {
		this.linkman = linkman;
	}
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getFax() {
		return fax;
	}
	public void setFax(String fax) {
		this.fax = fax;
	}
	public String getOther() {
		return other;
	}
	public void setOther(String other) {
		this.other = other;
	}
	public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	public String getProject_file() {
		return project_file;
	}
	public void setProject_file(String projectFile) {
		project_file = projectFile;
	}
	public String getPerson() {
		return person;
	}
	public void setPerson(String person) {
		this.person = person;
	}
	public Set<ProjectContract> getProjectContract() {
		return projectContract;
	}
	public void setProjectContract(Set<ProjectContract> projectContract) {
		this.projectContract = projectContract;
	}
	public Set<DocumenTary> getTarys() {
		return tarys;
	}
	public void setTarys(Set<DocumenTary> tarys) {
		this.tarys = tarys;
	}
	public Set<Configure> getConfigures() {
		return configures;
	}
	public void setConfigures(Set<Configure> configures) {
		this.configures = configures;
	}
	public Date getRepairDay() {
		return repairDay;
	}
	public void setRepairDay(Date repairDay) {
		this.repairDay = repairDay;
	}
	public String getShareperson() {
		return shareperson;
	}
	public void setShareperson(String shareperson) {
		this.shareperson = shareperson;
	}
	public Date getDay() {
		return day;
	}
	public void setDay(Date day) {
		this.day = day;
	}
	
}
